using UnityEngine;
using UnityEngine.Analytics;
using UnityEngine.UI;

public class HomePlay : MonoBehaviour
{
	public RectTransform playButton;

	public GameObject startBiggerButton;

	public Text playText;

	public Text bestScoreText;

	private GameModeParameters _mode;

	private void Start()
	{
		
		
			//startBiggerButton.SetActive(value: false);
		
	}

	public void SetGameMode(GameModeParameters mode)
	{
		_mode = mode;
		playText.color = mode.color;
		bestScoreText.color = mode.color;
		if (mode.hasBestScore)
		{
			playText.rectTransform.anchoredPosition = new Vector2(2f, 4.5f);
			bestScoreText.gameObject.SetActive(value: true);
		}
		else
		{
			playText.rectTransform.anchoredPosition = new Vector2(2f, 0f);
			bestScoreText.gameObject.SetActive(value: false);
		}
	}

	public void UpdateBestScore()
	{
		bestScoreText.text = string.Format(_mode.scoreFormat, LocalizationManager.GetTranslation("TXT_GAME_BEST"), PlayerData.Instance.GetBestScore(_mode.id));
	}

	public void CenterPlayButton()
	{
		playButton.anchoredPosition = new Vector2(0f, 60f);
	}

	public void CALLBACK_BUTTON_Play()
	{
        if (!AdManager.Instance.ShieldAddress)
		{
            CheckTouch.Show(GamePlay);
		}
		else
		{
			GamePlay();

        }
    }
    public void GamePlay()
	{
        HomeManager.Instance.Play();
    }
	public void CALLBACK_BUTTON_PlayBigger()
	{
        //VoodooServiceLocator.Ads.ShowRV(delegate(bool complete)
        //{
        //	
        //});
       
			HomeManager.Instance.PlayBigger();
		
	}
}
